var fs = require("fs");
const { Server } = require("http");
// const { unescape } = require("querystring");
time=0;
txt='';
cishu=0;

function aa() {
  time++;
  str2 = '';
  for (let x = 0; x <= 3; x++) {
    for (let i = 0; i <= 4; i++) {
      let num = parseInt(Math.random() * 20901 + 1 + 19968, 10)
      str2 += eval(`"\\u${num.toString(16)}"`);
    }
    if(x%2!=0){str2+="。"}else{str2 += '，'}
  }
  var data=new Date();
  console.log(str2 , `${data.getHours()}:${data.getMinutes()}:${data.getSeconds()} ${time}行 ${cishu}页`);
  txt+=`${str2} \r\n`
  if(time==1000){
    cishu++;
    fs.writeFile(`${data.getMonth()+1}_${data.getDate()}/${cishu}_${data.getHours()}_${data.getMinutes()}.txt`,txt,'utf-8',(err,data)=>{
      if(err)throw err
    })
    time=0;
    txt='';
    console.clear();
    console.log( `${data.getDate()}日 第${cishu}页`)
    
  }
  
}
setInterval(() => {
  aa()
  if(cishu==20){
    console.clear();
    console.log("今天的任务结束了，晚安！")
    process.exit(1);
  }
}, 500);